<template>
	<div>
		<div class="list-details-left">
			<i :style="{'backgroundImage':'url('+detailContent.imgUrl+')'}" v-if="detailContent.imgUrl"></i>
		</div>
		<div class="list-details-right">
		    <router-link :to="{'path':'/particulars'}">{{detailContent.title}}</router-link>
		    <p>
		        {{detailContent.content}}
                <router-link :to="{'path':'/particulars'}">详情</router-link>
		    </p>
		    <div class="details-right-bottom">
		    	<div class="list-time-author">
		    		<span>{{detailContent.day}}&nbsp;{{detailContent.times}}</span>
		    		<span>{{detailContent.author}}</span>
		    	</div>
		    	<div class="list-icon">
		    		<i><router-link :to="{'path':'/particulars'}"></router-link></i>
		    		<i :class="{'icon-shouCang':isShouCang}" @click="changeIcon(1)"></i>
		    		<i :class="{'icon-dianZan':isDianZan}" @click="changeIcon(2)"></i>
		    	</div>
		    </div>
		</div>
	</div>
	
</template>

<script>
	export default {
		data () {
			return {
				isPingLun: false,
				isShouCang: false,
				isDianZan: false,
				iconContent: ''
			}
		},
		methods: {
			changeIcon (num) {
				var that = this
				if (num === 1) {
					that.isShouCang = !that.isShouCang
					if(that.isShouCang) {
						that.iconContent = '收藏成功'
					} else {
						that.iconContent = '取消收藏'
					}
				} else if (num === 2) {
					that.isDianZan = !that.isDianZan
					if(that.isDianZan) {
						that.iconContent = '点赞成功'
					} else {
						that.iconContent = '取消点赞'
					}
				}
				that.$emit('popContent',that.iconContent)
			}
		},
		props:['detailContent']
	}
</script>

<style scoped>
	@import url('../../../static/navDetails/navListDetComp.css');
</style>